<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="../layuimini-v2/images/favicon.ico">
    <%--    <link rel="stylesheet" href="../layuimini-v2/lib/layui-v2.6.3/css/layui.css" media="all">--%>
    <%--    <link rel="stylesheet" href="../layuimini-v2/css/layuimini.css?v=2.0.4.2" media="all">--%>


    <%--    导航布局颜色--%>
    <%--    <link rel="stylesheet" href="../layuimini-v2/css/themes/default.css" media="all">--%>
    <link rel="stylesheet" href="../layuimini-v2/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">

    <title>新闻发布系统</title>
    <!-- 引入 LayUI 样式文件 -->
    <link rel="stylesheet" type="text/css" href="../layui-v2.9.10/layui/css/layui.css"/>
    <!-- 自定义样式 -->
    <style>
        body {
            background-color: #f5f5f5;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
        }
        .layui-header {
            background-color: #009688; /* 使用 LayUI 绿色背景色 */
            color: #fff;
            padding: 0 15px;
        }
        .layui-header .layui-logo {
            font-size: 24px;
            line-height: 60px;
            margin-right: 30px;
        }
        /*导航色彩*/
        .layui-nav-child{
            color: #0C0C0C;
        }
        .layui-side, .layui-layout-admin .layui-body, .layui-footer {
            background-color: #f5f5f5;
            color: #333;
        }
        .layui-card-header {
            background-color: #009688; /* 使用 LayUI 绿色背景色 */
            color: #fff;
        }
        .layui-card-body {
            background-color: #fff;
            color: #333;
        }
        .layui-layout-admin .layui-body {
            padding: 15px;
        }
        .layui-side {
            background-color: #333; /* 背景颜色 */
            flex-shrink: 0;
        }
        .layui-side-scroll {
            height: 100%; /* 高度设为100% */
            overflow: auto;
        }
    </style>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <%--    顶部--%>



        <div class="layui-header">
            <a href="home.jsp" >
                <div class="layui-logo layui-hide-xs">新闻发布系统</div>
            </a>


            <!-- 头部区域 -->
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item"><a >用户管理</a></li>
                <li class="layui-nav-item"><a >新闻管理</a></li>
            </ul>

            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
                    <a href="home.jsp">
                        <img src="../image/back-image.jpg" class="layui-nav-img"> <!-- 修改为实际用户头像链接 -->
                        <%= session.getAttribute("username") %>
                    </a>
                    <dl class="layui-nav-child" style="color: #0C0C0C">
                        <dd><a href="home.jsp">首页</a></dd>
                        <dd><a href="info.jsp">个人信息</a></dd>
                        <dd><a href="setting.jsp">设置</a></dd>
                        <dd><a href="../home/login-2.jsp;">退出</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                    <a>
                        <i class="layui-icon layui-icon-more-vertical"></i>
                    </a>
                </li>
            </ul>

        </div>


        <div class="layui-side">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域 -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a >用户管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="../SearchAllServlet.do;">用户查询</a></dd>

                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a >新闻管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="NewsPublish.jsp">新闻发布</a></dd>
                            <dd><a href="../NewsServlet.do">新闻浏览</a></dd>
                        </dl>
                    </li>

                </ul>
            </div>
        </div>



        <!--初始化加载层-->
    <div class="layuimini-loader">
        <div class="layuimini-loader-inner"></div>
    </div>

    <!--手机端遮罩层-->
    <div class="layuimini-make"></div>

    <!-- 移动导航 -->
    <div class="layuimini-site-mobile"><i class="layui-icon"></i></div>



        <div class="layui-body" id="mainContent">
            <!-- 内容主体区域 -->
            <div class="layui-row" style="margin-top: 20px;">
                <div class="layui-col-md6 layui-col-md-offset3">
                    <form class="layui-form" action="../changePassword.do" method="post">
                        <div class="layui-form-item">
                            <label class="layui-form-label">旧密码</label>
                            <div class="layui-input-block">
                                <input type="password" name="oldPassword" lay-verify="required" placeholder="请输入旧密码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">新密码</label>
                            <div class="layui-input-block">
                                <input type="password" name="newPassword" lay-verify="required" placeholder="请输入新密码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="formDemo">立即修改</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>



        <div class="layui-footer">
        <a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
    </div>
</div>

<!-- 引入 LayUI JavaScript 文件 -->
<script src="//cdn.staticfile.org/layui/2.9.10/layui.js"></script>
<script src="../layuimini-v2/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="../layuimini-v2/js/lay-config.js?v=2.0.0" charset="utf-8"></script>
<script>

        layui.use('form', function(){
        var form = layui.form;

        // 监听提交
        form.on('submit(formDemo)', function(data){
        // 表单提交后的处理逻辑，可以在这里添加 loading 效果等
    });
    });


<%--        js-layui--%>
layui.use(['jquery', 'layer', 'miniAdmin','miniTongji'], function () {
var $ = layui.jquery,
layer = layui.layer,
miniAdmin = layui.miniAdmin,
miniTongji = layui.miniTongji;

var options = {
            iniUrl: "../layuimini-v2/api/init.json",    // 初始化接口
            clearUrl: "../layuimini-v2/api/clear.json", // 缓存清理接口
            urlHashLocation: true,      // 是否打开hash定位
            bgColorDefault: false,      // 主题默认配置
            multiModule: true,          // 是否开启多模块
            menuChildOpen: false,       // 是否默认展开菜单
            loadingTime: 0,             // 初始化加载时间
            pageAnim: true,             // iframe窗口动画
            maxTabNum: 20,              // 最大的tab打开数量
        };
        miniAdmin.render(options);

        // 百度统计代码，只统计指定域名
        miniTongji.render({
            specific: true,
            domains: [
                '99php.cn',
                'layuimini.99php.cn',
                'layuimini-onepage.99php.cn',
            ],
        });

        $('.login-out').on("click", function () {
            layer.msg('退出登录成功', function () {
                window.location = 'page/login-3.html';
            });
        });
    });


    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element;
        var layer = layui.layer;
        var util = layui.util;
        var $ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            menuLeft: function(othis){ // 左侧菜单事件
                layer.msg('展开左侧菜单的操作', {icon: 0});
            },
            menuRight: function(){  // 右侧菜单事件
                layer.open({
                    type: 1,
                    title: '更多',
                    content: '<div style="padding: 15px;">处理右侧面板的操作</div>',
                    area: ['260px', '100%'],
                    offset: 'rt', // 右上角
                    anim: 'slideLeft', // 从右侧抽屉滑出
                    shadeClose: true,
                    scrollbar: false
                });
            }
        });
    });
</script>
</body>

</html>
